<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_users
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @since		1.5
 */

defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.noframes');
$session = JFactory::getSession();
$app = JFactory::getApplication();
$template = JURI::base() . 'templates/' . $app->getTemplate();
?>


<?php                        	       
$input_username = JText::_( 'Indtast din username' );
$input_password = JText::_( 'Indtast din adgangskode' );
	
?>                        
 <script type="text/javascript">                   
jQuery(document).ready(function(jQuery) {
	jQuery.validator.addMethod('postalcode', function (value) { 
		if(value=='') return true;	
		return /^\d{4}$/.test(value); 
	   }, '');
		
		
		jQuery("#loginForm").validate(
			{
				errorPlacement: function(error, element) {			
			},
			invalidHandler: function(form, validator) {
			  var errors = validator.numberOfInvalids();
			if (errors) {
                //$('#alert').html(validator['errorList'][0]['message']);
				jQuery('#alert').html(validator['errorList'][0]['message']);
    			jQuery('#backoverlay').show();
    			jQuery('#show_popup').show();
            	/*$('#f_focus').html(validator['errorList'][0]['element'].name);
				validator['errorList'][0]['element'].focus();
				*/
			  } else {
			  }
			},
			rules: {
                username : "required",				
				password : "required",
				
			},
			messages: {
                username: "<?php echo $input_username; ?>",
				password: "<?php echo $input_password; ?>"
				
			}
		});
        close_popup=function(){		
			var fel=jQuery('#f_focus').html();
            jQuery('#backoverlay').hide();
    		jQuery('#show_popup').hide();
    		jQuery('#' + fel ).focus();		
      };
      
      
	});
</script>
<div id="header">
  <div id="w-header">
    <div class="logo"><a href="index.php">Forside</a> </div>
    <!--.logo-->
     {module login menu}    
    <!--.nav-top-1-->
    <div class="clear"></div>
    <div class="main-nav">
      {module main menu}
    </div>
    <!--.main-nav-->
    <div class="clear"></div>
  </div>
  <!--#w-header--> 
</div>
<!--#header-->

<div id="main">
  <div id="w-main">
    <div id="main-left">
	<div class="left-find"></div>
	<div class="right-find"></div>
		<div class="find">
			{module search}
		</div> 
      <!--.find-->
      <div class="clear"></div>
      <div class="infomation">
		<?php $article = JUtility::getArticle(15); ?>
        <h2><a href="#"><?php echo $article->title; ?></a></h2>
        <?php echo $article->introtext; ?>
      </div>
      <!--.infomation--> 
    </div>
    <!--#main-left-->
  <div id="main-right2">
      <div id="login-page">
       	<div class="w-login-form">
       		<h2>login</h2>        
		<form name="loginForm" id="loginForm" action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post">
        	<fieldset>
            	<div>
                	<label>EMAIL ADRESSE:</label><br>
                    <input name="username" id="username" type="text" value="">
                </div>
                <div>
                	<label>PASSWORD:</label><br>
                    <input name="password" id="password" type="password" value="">
                </div>
                <div>
                	<p><a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">Glemt password?</a> |  <a href="<?php echo JRoute::_('index.php?option=com_users&view=registration1'); ?>">Opret profil</a></p>
                </div>
                <div class="clear"></div>
                <div class="line-bottom">
                	<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
                	<input class="cb" id="remember" type="checkbox" name="remember"  value="yes">
                    <span><a href="#">Husk mig?</a></span>
                    <?php endif; ?>
                </div>
                <div class="bnt-login">
                	<a onclick="jQuery('#loginForm').submit();" >Login</a>
                    <input type="submit" style="display:none;" />
                </div><!--bnt-login-->
                <div class="back">
                	<h4><a onclick="javascript:history.back();"  >Tilbage</a></h4>
                </div><!--.black-->
            </fieldset>
            <input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', JURI::base())); ?>" />
			<?php echo JHtml::_('form.token'); ?>
        </form>
      	</div>
      <!--.f-create-Order--> 
      
      </div>
    </div>
    <!--#main-right--> 
  </div>
  <!--#w-main--> 
</div>
<!--#main-->
<div class="clear"></div>
<div id="contact">
  <div id="w-contact">
    <div class="left-con">
      <div class="left-con-top"></div>
      <!--left-con-top-->
      <div class="left-con-mid">
        <div class="contact-con">
		<?php $article = JUtility::getArticle(17); ?>
          <h2><a href="#"><?php echo $article->title; ?></a></h2>
          <?php echo $article->introtext; ?>
        </div>
        <!--.contact-con-->
        <div class="contact-con contact-con2">
			<?php $article = JUtility::getArticle(18); ?>
			<h2><a href="#"><?php echo $article->title; ?></a></h2>
			<?php echo $article->introtext; ?>
        </div>
        <!--.contact-con--> 
      </div>
      <!--left-con-mid-->
      <div class="left-con-bottom"></div>
      <!--left-con-bottom--> 
    </div>
    <!--.left-con-->
    
    <div class="address">
		<?php $article = JUtility::getArticle(16); ?>
		<h2><?php echo $article->title; ?></h2>
		<?php echo $article->introtext; ?>
    </div>
    <!--address--> 
    
    <div class="contact-form">
		{module kontakt}
    </div><!--.contact-form-->
  </div>
  <!--w-contact--> 
</div>
<!--#contact-->
<div class="clear"></div>
<div id="copyright">
	<div id="w-copyright">
		{module footer}
	</div>
</div>
<!--#copyright-->








<?php return; ?>
  
  <div id="header2">
  <div id="w-header2">
   	<div class="logo2"><a href="<?php echo JRoute::_('.');?>">kokketilbud</a></div><!--.logo2-->
  </div>
  <!--#w-header2--> 
</div>
<!--#header2-->
<div id="main2">
  <div id="w-main2">
    <div id="login-page">
    <h2>Login</h2>
    <div class="w-login-form">
   	  <div class="login-top-page"></div><!--.login-top-page-->
      <div class="login-mid-page">
      	<form name="loginForm" id="loginForm" action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post">
        	<fieldset>
            	<div>
                	<label>EMAIL ADRESSE:</label><br>
                    <input name="username" id="username" type="text" value="">
                </div>
                <div>
                	<label>PASSWORD:</label><br>
                    <input name="password" id="password" type="password" value="">
                </div>
                <div>
                	<p><a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">Glemt password?</a> |  <a href="<?php echo JRoute::_('index.php?option=com_users&view=registration1'); ?>">Opret profil</a></p>
                </div>
                <div class="clear"></div>
                <div class="line-bottom">
                	<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
                	<input class="cb" id="remember" type="checkbox" name="remember"  value="yes">
                    <span><a href="#">Husk mig?</a></span>
                    <?php endif; ?>
                </div>
                <div class="bnt-login">
                	<a onclick="jQuery('#loginForm').submit();" >Login</a>
                    <input type="submit" style="display:none;" />
                </div><!--bnt-login-->
                <div class="back">
                	<h4><a onclick="javascript:history.back();"  >Tilbage</a></h4>
                </div><!--.black-->
            </fieldset>
            <input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', JURI::base())); ?>" />
			<?php echo JHtml::_('form.token'); ?>
        </form>
        <div class="clear"></div>
      </div><!--.login-mid-page-->
      <div class="login-bottom-page"></div><!--.login-bottom-page-->
    </div><!--#login-page-->
    </div><!--.w-login-form-->
   </div><!--#w-main2-->
</div><!--#main2-->





	
<?php return; ?>
<div class="login<?php echo $this->pageclass_sfx?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
	<h1>
		<?php echo $this->escape($this->params->get('page_heading')); ?>
	</h1>
	<?php endif; ?>

	<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
	<div class="login-description">
	<?php endif ; ?>

		<?php if($this->params->get('logindescription_show') == 1) : ?>
			<?php echo $this->params->get('login_description'); ?>
		<?php endif; ?>

		<?php if (($this->params->get('login_image')!='')) :?>
			<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JTEXT::_('COM_USER_LOGIN_IMAGE_ALT')?>"/>
		<?php endif; ?>

	<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
	</div>
	<?php endif ; ?>

	<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post">

		<fieldset>
			<?php foreach ($this->form->getFieldset('credentials') as $field): ?>
				<?php if (!$field->hidden): ?>
					<div class="login-fields"><?php echo $field->label; ?>
					<?php echo $field->input; ?></div>
				<?php endif; ?>
			<?php endforeach; ?>
			<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
			<div class="login-fields">
				<label id="remember-lbl" for="remember"><?php echo JText::_('JGLOBAL_REMEMBER_ME') ?></label>
				<input id="remember" type="checkbox" name="remember" class="inputbox" value="yes"  alt="<?php echo JText::_('JGLOBAL_REMEMBER_ME') ?>" />
			</div>
			<?php endif; ?>
			<button type="submit" class="button"><?php echo JText::_('JLOGIN'); ?></button>
			<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', $this->form->getValue('return'))); ?>" />
			<?php echo JHtml::_('form.token'); ?>
		</fieldset>
	</form>
</div>
<div>
	<ul>
		<li>
			<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
			<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
		</li>
		<li>
			<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>">
			<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?></a>
		</li>
		<?php
		$usersConfig = JComponentHelper::getParams('com_users');
		if ($usersConfig->get('allowUserRegistration')) : ?>
		<li>
			<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
				<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
		</li>
		<?php endif; ?>
	</ul>
</div>
